<template>
    <div class="item-content  bg-img" >
        <div class="item-title bg-img">
            <span>温湿度</span>
        </div>
        <div class="main">
            <el-carousel height="100%" autoplay class="carousel" indicator-position="none">
                <el-carousel-item>
                    <TempeHumidityEchart class="echart-nav"></TempeHumidityEchart>
                </el-carousel-item>
                <el-carousel-item>
                    <TempeHumidityEchart class="echart-nav"></TempeHumidityEchart>
                </el-carousel-item>
            </el-carousel>
        </div>
        <div class="foot flex-center">
            <div class="nav left flex-column flex-center bg-img">
                <div class="title">
                    <span>24.9</span>
                    <span>℃</span>
                </div>
                <div class="text">当前温度</div>
            </div>
            <div class="nav right flex-column flex-center bg-img">
                <div class="title">
                    <span>50.3</span>
                    <span>%</span>
                </div>
                <div class="text">当前湿度</div>
            </div>
        </div>
    </div>
</template>

<script setup>
    import {defineAsyncComponent} from "vue";

    const TempeHumidityEchart = defineAsyncComponent(() => import('@/components/echarts/tempeHumidityEchart.vue'));

</script>

<style scoped lang="scss">
    .foot{
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        height: 40px;
        margin-top: 10px;
        .nav{
            height: 100%;
            background: linear-gradient(to right, rgba(18, 72, 106, 0.6784313725), rgb(20 118 197 / 93%));
            transform: skewX(353deg);
            border-radius: 4px;
            padding: 4px;
            font-size: 13px;
            flex: 0.4;
        }
    }
    .main{
        height: 70%;

        .carousel{
            height: 100%;
        }
        .echart-nav{
            height: 100%;
        }
    }

    .item-content::before{
        border-left: 2px solid #4fd5e1;
        position: absolute;
        width: 8px;
        height: 8px;
        opacity: 1;
        content: "";
        border-top: 2px solid #4fd5e1;
        top: 0px;
        border-radius: 2px;
        left: 0px;
    }
    .item-content::after{
        position: absolute;
        width: 8px;
        height: 8px;
        opacity: 1;
        content: "";
        border-bottom: 2px solid #4fd5e1;
        bottom: -1px;
        border-radius: 2px;
        border-right: 2px solid #4fd5e1;
        right: 0px;
    }

    .item-content{
        position: relative;
        border-radius: 4px;
        background-color: rgb(40 57 111 / 47%);
        margin-bottom: 2%;
        height: 33%;
        color:#fff;
        .item-title{
            font-size: 18px;
            background-size: 100% 100%;
            background-image: url("@/assets/imgs/31.png");
            height: 11%;
            padding-left: 10%;
            display: flex;
            align-items: center;
            span{
                background: linear-gradient(to bottom, #fff, #055eff);
                color: transparent;
                background-clip: text;
                font-weight: bold;
            }
        }
    }

</style>